#ifndef NETWORK_H
#define NETWORK_H

#include<QNetworkAccessManager>
#include<QNetworkReply>

class NetWork :public QObject
{
    Q_OBJECT
public:
    explicit NetWork(QString url);
    QByteArray getData();
    QString getUrl();
    ~NetWork();
protected slots:
    void onEror(QNetworkReply::NetworkError code);
    void onFinished();
private:
    QNetworkAccessManager m_nam;
    QNetworkReply *m_reply;
    QByteArray m_data;
    QString m_url;
};
#endif // NETWORK_H
